package com.biz.primus.ms.evaluation.feign;

import com.biz.primus.model.order.vo.OrderVO;
import com.biz.primus.model.order.vo.request.OrderCodeVO;
import com.biz.primus.model.order.vo.response.OrderResponseVO;
import com.biz.primus.ms.evaluation.degraded.DegradedOrderFeignClient;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * OrderFeignClient
 *
 * @author Tiger Feng
 * @date 2017年11月07日
 */
@FeignClient(qualifier = "orderFeignClient", name = "service-order", fallback = DegradedOrderFeignClient.class)
public interface OrderFeignClient {
    /**
     * 根据订单编号获取订单
     *
     * @param orderCodeVO
     * @return
     */
    @PostMapping("soa/orderService/queryByOrderCode")
    OrderResponseVO queryByOrderCode(@RequestBody OrderCodeVO orderCodeVO);

    /**
     * 评价订单，调用订单接口，更新订单状态为已评价
     *
     * @param orderCode
     * @return
     */
    @PostMapping("soa/orderService/evaluateOrderState")
    void evaluateOrderState(@RequestParam("orderCode") String orderCode);
}
